home *** CD-ROM | disk | FTP | other *** search
/ Macintosh Compilation 1 / Macintosh Compilation CD Number 1 (December 1995).iso / Internet / InterPPP™ 1.2.1 / Generic CCLs / A Generic 9600 Modem < prev    next >
Encoding:
Text File  |  1994-08-10  |  2.6 KB  |  176 lines

  1. !
  2. ! A Generic 9600 baud modem CCL script...
  3. !
  4. @ORIGINATE
  5. @ANSWER
  6. !
  7. @LABEL 1
  8. serreset 9600, 0, 8, 1
  9. !
  10. ! Reset modem to factory settings
  11. !
  12. settries 0
  13. matchclr
  14. matchstr 1 3 "OK\13\10"
  15. @LABEL 2
  16. write "AT&F\13"
  17. matchread 20
  18. inctries
  19. iftries 2 59
  20. !
  21. ! No response (well, no "OK".); Try wiggling the DTR line
  22. !
  23. DTRClear
  24. pause 5
  25. DTRSet
  26. jump 2
  27. !
  28. !
  29. !
  30. @LABEL 3
  31. matchstr 1 4 "OK\13\10"
  32. write "AT\13"
  33. matchread 30
  34. jump 59
  35. !
  36. ! Assuming that the modem speaker is on, if str 2 is "0" turn it off
  37. !
  38. @LABEL 4
  39. ifstr 2 6 "1"
  40. matchstr 1 6 "OK\13\10"
  41. write "ATM0\13"
  42. matchread 30
  43. jump 59
  44. !
  45. ! The modem is ready so enable answering, or originate a call
  46. !
  47. @LABEL 6
  48. ifANSWER 30
  49. note "Dialing ^1" 3
  50. write "ATDT^1\13"
  51. !
  52. @LABEL 9
  53. matchstr 1 11 "CONNECT 1200\13\10"
  54. matchstr 2 12 "CONNECT 2400\13\10"
  55. matchstr 3 13 "CONNECT 4800\13\10"
  56. matchstr 4 14 "CONNECT 9600\13\10"
  57. matchstr 6 50 "NO CARRIER\13\10"
  58. matchstr 7 50 "ERROR\13\10"
  59. matchstr 8 52 "NO DIALTONE\13\10"
  60. matchstr 9 53 "BUSY\13\10"
  61. matchstr 10 54 "NO ANSWER\13\10"
  62. matchread 900
  63. jump 59
  64. !
  65. @LABEL 11
  66. note "Communicating at 1200 bps." 2
  67. CommunicatingAt 1200
  68. serreset 1200, 0, 8, 1
  69. jump 20
  70. !
  71. @LABEL 12
  72. note "Communicating at 2400 bps." 2
  73. CommunicatingAt 2400
  74. serreset 2400, 0, 8, 1
  75. jump 20
  76. !
  77. @LABEL 13
  78. note "Communicating at 4800 bps." 2
  79. CommunicatingAt 4800
  80. serreset 4800, 0, 8, 1
  81. jump 20
  82. !
  83. @LABEL 14
  84. note "Communicating at 9600 bps." 2
  85. CommunicatingAt 9600
  86. serreset 9600, 0, 8, 1
  87. jump 20
  88. !
  89. @LABEL 20
  90. ifANSWER 21
  91. pause 30
  92. @LABEL 21
  93. exit 0
  94. !
  95. ! @ANSWER
  96. ! Set up the modem to answer
  97. !
  98. @LABEL 30
  99. write "ATS0=1\13"
  100. matchstr 1 31 "OK\13\10"
  101. matchread 30
  102. jump 59
  103. !
  104. @LABEL 31
  105. matchstr 1  32 "RING\13\10"
  106. matchstr 2  11 "CONNECT 1200\13\10"
  107. matchstr 3  12 "CONNECT 2400\13\10"
  108. matchstr 4  13 "CONNECT 4800\13\10"
  109. matchstr 5  14 "CONNECT 9600\13\10"
  110. matchstr 7  50 "NO CARRIER\13\10"
  111. matchstr 8  50 "ERROR\13\10"
  112. matchstr 9  52 "NO DIALTONE\13\10"
  113. matchstr 10  53 "BUSY\13\10"
  114. matchstr 10 54 "NO ANSWER\13\10"
  115. matchread 700
  116. jump 31
  117. !
  118. @LABEL 32
  119. userhook 1
  120. note "Answering the phone…" 2
  121. jump 31
  122. !
  123. ! 50: error messages
  124. !
  125. @LABEL 50
  126. exit -6021
  127. !
  128. @LABEL 52
  129. exit -6020
  130. !
  131. @LABEL 53
  132. exit -6022
  133. !
  134. @LABEL 54
  135. exit -6023
  136. !
  137. @LABEL 59
  138. exit -6019
  139. !
  140. ! Attempt to hang up the modem
  141. !
  142. @HANGUP
  143. @LABEL 60
  144. settries 0
  145. @LABEL 61
  146. matchclr
  147. matchstr 1 62 "OK\13\10"
  148. matchstr 2 62 "NO CARRIER\13\10"
  149. matchstr 3 62 "ERROR\13\10"
  150. write "ATH\13"
  151. matchread 10
  152. inctries
  153. iftries 3 62
  154. !
  155. ! No response to "AT", attempt escape sequence
  156. !
  157. DTRClear
  158. pause 5
  159. DTRSet
  160. write "+++"
  161. matchclr
  162. matchstr 1 61 "OK\13\10"
  163. matchread 15
  164. jump 61
  165. !
  166. @LABEL 62
  167. ! set modem back to factory settings
  168. pause 5
  169. write "AT&F\13"
  170. matchclr
  171. matchstr 1 63 "OK\13\10"
  172. matchread 30
  173. !
  174. @LABEL 63
  175. exit 0
  176.